import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { ReactiveFormsModule } from '@angular/forms';
import { NgZorroAntdModule } from 'ng-zorro-antd';

import { FocusDirective } from './_common/_directive/focus.directive';
import { RenameTitleDirective } from './_common/_directive/rename-title.directive';

import { AppRoutingModule } from './app-routing.module';

import { AppComponent } from './app.component';
import { TaskService } from './_common/_service/task.service';
import { MyDayComponent } from './myDay/my-day.component';
import { TodoComponent } from './todo/todo.component';
import { SearchComponent } from './search/search.component';
import { SiderComponent } from './sider/sider.component';

import { ListService } from './_common/_service/list.service';
import { CookieService } from 'ng2-cookies';
import { UserService } from './_common/_service/user.service';
import { SiderUserComponent } from './sider/user/user.component';
import { HomeComponent } from './home/home.component';
import { LoginComponent } from './login/login.component';
import { AppConsts } from './_common/consts';
import { AuthGuard } from './_common/_guards/auth.guard';
import { Functions } from './_common/functions';
import { SiderContextmenuComponent } from './sider/contextmenu/contextmenu.component';
import { TodoContextmenuComponent } from './todo/contextmenu/contextmenu.component';
import { DetailComponent } from './todo/detail/detail.component';
import { RenderDeadlinePipe } from './_common/_pipes/renderDeadline.pipe';

@NgModule({
  declarations: [
    AppComponent,
    LoginComponent,
    HomeComponent,
    SiderComponent,
    SiderUserComponent,
    MyDayComponent,
    TodoComponent,
    SearchComponent,
    LoginComponent,
    FocusDirective,
    RenameTitleDirective,
    SiderContextmenuComponent,
    TodoContextmenuComponent,
    DetailComponent,
    RenderDeadlinePipe
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    BrowserAnimationsModule,
    ReactiveFormsModule,
    // 在根 module 中需要使用 NgZorroAntdModule.forRoot()，在子 module 需要使用 NgZorroAntdModule
    NgZorroAntdModule.forRoot(),
    AppRoutingModule
  ],
  providers: [
    AppConsts,
    Functions,
    AuthGuard,
    ListService,
    TaskService,
    UserService,
    CookieService
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
